﻿using System;
using System.Collections.Generic;
using System.Text;

using System.Runtime.InteropServices;

namespace Scenario.WAPI
{
    public partial class UserHelper
    {
        [DllImport("WAPI.Dll", EntryPoint = "authenticate")]
        private static extern int Authenticate(String sUserKey, String sPassword, ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "isInRole")]
        private static extern int IsInRole(String sUserKey, String sRole, ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "getUser",CharSet = CharSet.Ansi)]
        [return: MarshalAs(UnmanagedType.AnsiBStr)]
        private static extern String GetUser(String sUserKey, ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "getUsers", CharSet = CharSet.Ansi)]
        [return: MarshalAs(UnmanagedType.AnsiBStr)]
        internal static extern String GetUsers(ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "getUsersByRole", CharSet = CharSet.Ansi)]
        [return: MarshalAs(UnmanagedType.AnsiBStr)]
        private static extern String GetUsersByRole(String sRole, ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "createUser")]
        private static extern void CreateUser(String sUser, ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "updateUser")]
        private static extern void UpdateUser(String sUser, ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "deleteUser")]
        private static extern void DeleteUser(String sUserKey, ref Response response);
    }
}
